package cn.ddm.hrm.controller;

import cn.ddm.hrm.service.IVerifyCodeService;
import cn.ddm.hrm.util.AjaxResult;
import cn.ddm.hrm.util.VerifyCodeUtils;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;
import java.util.Map;

@RestController
@RequestMapping("/verifycode")
public class VerifyCodeController {

    @Autowired
    private IVerifyCodeService verifyCodeService;

    /**
     * 用于验证码发送
     * @param params 前台填写的电话号码
     * @return
     */
    @PostMapping("/sendSmsCode")
    @ResponseBody
    public AjaxResult sendRegisterSmsCode(@RequestBody Map<String, String> params) {
        return verifyCodeService.sendRegisterSmsCode(params);
    }
}